package com.day1012.afternoon;

public class OldClimb extends Thread {
    private int speed = 10;
    private int time = 0;
    @Override
    public void run() {
        while (true){
            int juli = speed * time;
            if (juli % 100 == 0 && juli != 0){
                System.out.println("老年人爬完了100米");
            }
            time++;
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (juli == 1000){
                System.out.println("老年人到终点了。");
                break;
            }
        }
    }
}
